package com.blb.mapper;

import com.blb.entity.Settlement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yanghao
 * @since 2019-11-22
 */
public interface SettlementMapper extends BaseMapper<Settlement> {

    public int getAllCount(@Param("freightId") String freightId,@Param("companyId") String  companyId);

    public List<Settlement> findAll(@Param("freightId") String freightId,@Param("companyId") String  companyId, @Param("start") int start, @Param("length") int length);

    @Update("UPDATE t_settlement SET Settlement_status='1' WHERE Settlement_id=#{id}")
    public void updateStatus(String id);

    @Insert("INSERT INTO `t_settlement` (`Settlement_id`, `shipping_num`, `Settlement_status`) VALUES (#{settlementId}, #{shippingNum}, #{settlementStatus})")
    public void  addSettlement(Settlement settlement);

}
